package encodejson

import (
	"bufio"
	"encoding/json"
	"os"
)

type SshConfig struct {
	SshKey        string
	SshHost       string
	SshUser       string
	SshPassWord   string
	SshPort       int
	LocalFilePath string
	RemoteDir     string
}

func GetConfig() (*SshConfig, error) {
	file, _ := os.Open("../config.json")
	reader := bufio.NewReader(file)
	decoder := json.NewDecoder(reader)
	config := &SshConfig{}
	if err := decoder.Decode(config); err != nil {
		return nil, err
	}
	return config, nil
}
